package com.xiang.sql.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 库存 数据实体
 * 
 * @author mac-xiang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`stock`", autoResultMap = true)
@ApiModel(value = "库存 对象", description = "库存")
public class Stock implements Serializable {

  private static final long serialVersionUID = 1L;
  /** id */
  @TableId(value = "id", type = IdType.ASSIGN_ID)
  public String id;

  /** 创建时间 */
  @TableField(value = "`create_time`", fill = FieldFill.INSERT)
  public Long createTime;

  /** 归属商家 */
  @TableField(value = "`gid`", fill = FieldFill.INSERT)
  public String gid;

  /** 商品id */
  @TableField(value = "`goods`", fill = FieldFill.INSERT)
  public String goods;

  /** 数量 */
  @TableField(value = "`sum`", fill = FieldFill.INSERT)
  public Integer sum;

  /** 商户名称 */
  @TableField(value = "_group_name", exist = false)
  public String groupName;
  /** 商品名称 */
  @TableField(value = "_goods_name", exist = false)
  public String goodsName;
  /** 商品单价 */
  @TableField(value = "_goods_money", exist = false)
  public Integer goodsMoney;

  public Stock() {
  }

  public Stock(String gid, String goods) {
    this.gid = gid;
    this.goods = goods;
    this.sum = 0;
  }
}